\(\int (a+b \sec (c+d x)) \tan ^6(c+d x) \, dx\) [264]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 19, antiderivative size = 102 \[ \int (a+b \sec (c+d x)) \tan ^6(c+d x) \, dx=-a x-\frac {5 b \text {arctanh}(\sin (c+d x))}{16 d}+\frac {(16 a+5 b \sec (c+d x)) \tan (c+d x)}{16 d}-\frac {(8 a+5 b \sec (c+d x)) \tan ^3(c+d x)}{24 d}+\frac {(6 a+5 b \sec (c+d x)) \tan ^5(c+d x)}{30 d} \]

[Out]

-a*x-5/16*b*arctanh(sin(d*x+c))/d+1/16*(16*a+5*b*sec(d*x+c))*tan(d*x+c)/d-1/24*(8*a+5*b*sec(d*x+c))*tan(d*x+c)
^3/d+1/30*(6*a+5*b*sec(d*x+c))*tan(d*x+c)^5/d

Rubi [A] (verified)

Time = 0.13 (sec) , antiderivative size = 102, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.105, Rules used = {3966, 3855} \[ \int (a+b \sec (c+d x)) \tan ^6(c+d x) \, dx=\frac {\tan ^5(c+d x) (6 a+5 b \sec (c+d x))}{30 d}-\frac {\tan ^3(c+d x) (8 a+5 b \sec (c+d x))}{24 d}+\frac {\tan (c+d x) (16 a+5 b \sec (c+d x))}{16 d}-a x-\frac {5 b \text {arctanh}(\sin (c+d x))}{16 d} \]

[In]

Int[(a + b*Sec[c + d*x])*Tan[c + d*x]^6,x]

[Out]

-(a*x) - (5*b*ArcTanh[Sin[c + d*x]])/(16*d) + ((16*a + 5*b*Sec[c + d*x])*Tan[c + d*x])/(16*d) - ((8*a + 5*b*Se
c[c + d*x])*Tan[c + d*x]^3)/(24*d) + ((6*a + 5*b*Sec[c + d*x])*Tan[c + d*x]^5)/(30*d)

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3966

Int[(cot[(c_.) + (d_.)*(x_)]*(e_.))^(m_)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Simp[(-e)*(e*Cot
[c + d*x])^(m - 1)*((a*m + b*(m - 1)*Csc[c + d*x])/(d*m*(m - 1))), x] - Dist[e^2/m, Int[(e*Cot[c + d*x])^(m -
2)*(a*m + b*(m - 1)*Csc[c + d*x]), x], x] /; FreeQ[{a, b, c, d, e}, x] && GtQ[m, 1]

Rubi steps \begin{align*} \text {integral}& = \frac {(6 a+5 b \sec (c+d x)) \tan ^5(c+d x)}{30 d}-\frac {1}{6} \int (6 a+5 b \sec (c+d x)) \tan ^4(c+d x) \, dx \\ & = -\frac {(8 a+5 b \sec (c+d x)) \tan ^3(c+d x)}{24 d}+\frac {(6 a+5 b \sec (c+d x)) \tan ^5(c+d x)}{30 d}+\frac {1}{24} \int (24 a+15 b \sec (c+d x)) \tan ^2(c+d x) \, dx \\ & = \frac {(16 a+5 b \sec (c+d x)) \tan (c+d x)}{16 d}-\frac {(8 a+5 b \sec (c+d x)) \tan ^3(c+d x)}{24 d}+\frac {(6 a+5 b \sec (c+d x)) \tan ^5(c+d x)}{30 d}-\frac {1}{48} \int (48 a+15 b \sec (c+d x)) \, dx \\ & = -a x+\frac {(16 a+5 b \sec (c+d x)) \tan (c+d x)}{16 d}-\frac {(8 a+5 b \sec (c+d x)) \tan ^3(c+d x)}{24 d}+\frac {(6 a+5 b \sec (c+d x)) \tan ^5(c+d x)}{30 d}-\frac {1}{16} (5 b) \int \sec (c+d x) \, dx \\ & = -a x-\frac {5 b \text {arctanh}(\sin (c+d x))}{16 d}+\frac {(16 a+5 b \sec (c+d x)) \tan (c+d x)}{16 d}-\frac {(8 a+5 b \sec (c+d x)) \tan ^3(c+d x)}{24 d}+\frac {(6 a+5 b \sec (c+d x)) \tan ^5(c+d x)}{30 d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.04 (sec) , antiderivative size = 179, normalized size of antiderivative = 1.75 \[ \int (a+b \sec (c+d x)) \tan ^6(c+d x) \, dx=-\frac {a \arctan (\tan (c+d x))}{d}-\frac {5 b \text {arctanh}(\sin (c+d x))}{16 d}+\frac {a \tan (c+d x)}{d}-\frac {5 b \sec (c+d x) \tan (c+d x)}{16 d}-\frac {5 b \sec ^3(c+d x) \tan (c+d x)}{24 d}+\frac {5 b \sec ^5(c+d x) \tan (c+d x)}{6 d}-\frac {a \tan ^3(c+d x)}{3 d}-\frac {5 b \sec ^3(c+d x) \tan ^3(c+d x)}{3 d}+\frac {a \tan ^5(c+d x)}{5 d}+\frac {b \sec (c+d x) \tan ^5(c+d x)}{d} \]

[In]

Integrate[(a + b*Sec[c + d*x])*Tan[c + d*x]^6,x]

[Out]

-((a*ArcTan[Tan[c + d*x]])/d) - (5*b*ArcTanh[Sin[c + d*x]])/(16*d) + (a*Tan[c + d*x])/d - (5*b*Sec[c + d*x]*Ta
n[c + d*x])/(16*d) - (5*b*Sec[c + d*x]^3*Tan[c + d*x])/(24*d) + (5*b*Sec[c + d*x]^5*Tan[c + d*x])/(6*d) - (a*T
an[c + d*x]^3)/(3*d) - (5*b*Sec[c + d*x]^3*Tan[c + d*x]^3)/(3*d) + (a*Tan[c + d*x]^5)/(5*d) + (b*Sec[c + d*x]*
Tan[c + d*x]^5)/d

Maple [A] (verified)

Time = 1.91 (sec) , antiderivative size = 143, normalized size of antiderivative = 1.40

method result size
derivativedivides \(\frac {a \left (\frac {\tan \left (d x +c \right )^{5}}{5}-\frac {\tan \left (d x +c \right )^{3}}{3}+\tan \left (d x +c \right )-d x -c \right )+b \left (\frac {\sin \left (d x +c \right )^{7}}{6 \cos \left (d x +c \right )^{6}}-\frac {\sin \left (d x +c \right )^{7}}{24 \cos \left (d x +c \right )^{4}}+\frac {\sin \left (d x +c \right )^{7}}{16 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )^{5}}{16}+\frac {5 \sin \left (d x +c \right )^{3}}{48}+\frac {5 \sin \left (d x +c \right )}{16}-\frac {5 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{16}\right )}{d}\) \(143\)
default \(\frac {a \left (\frac {\tan \left (d x +c \right )^{5}}{5}-\frac {\tan \left (d x +c \right )^{3}}{3}+\tan \left (d x +c \right )-d x -c \right )+b \left (\frac {\sin \left (d x +c \right )^{7}}{6 \cos \left (d x +c \right )^{6}}-\frac {\sin \left (d x +c \right )^{7}}{24 \cos \left (d x +c \right )^{4}}+\frac {\sin \left (d x +c \right )^{7}}{16 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )^{5}}{16}+\frac {5 \sin \left (d x +c \right )^{3}}{48}+\frac {5 \sin \left (d x +c \right )}{16}-\frac {5 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{16}\right )}{d}\) \(143\)
parts \(\frac {a \left (\frac {\tan \left (d x +c \right )^{5}}{5}-\frac {\tan \left (d x +c \right )^{3}}{3}+\tan \left (d x +c \right )-\arctan \left (\tan \left (d x +c \right )\right )\right )}{d}+\frac {b \left (\frac {\sin \left (d x +c \right )^{7}}{6 \cos \left (d x +c \right )^{6}}-\frac {\sin \left (d x +c \right )^{7}}{24 \cos \left (d x +c \right )^{4}}+\frac {\sin \left (d x +c \right )^{7}}{16 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )^{5}}{16}+\frac {5 \sin \left (d x +c \right )^{3}}{48}+\frac {5 \sin \left (d x +c \right )}{16}-\frac {5 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{16}\right )}{d}\) \(147\)
risch \(-a x -\frac {i \left (165 b \,{\mathrm e}^{11 i \left (d x +c \right )}-720 a \,{\mathrm e}^{10 i \left (d x +c \right )}-25 b \,{\mathrm e}^{9 i \left (d x +c \right )}-2160 a \,{\mathrm e}^{8 i \left (d x +c \right )}+450 b \,{\mathrm e}^{7 i \left (d x +c \right )}-3680 a \,{\mathrm e}^{6 i \left (d x +c \right )}-450 b \,{\mathrm e}^{5 i \left (d x +c \right )}-3360 a \,{\mathrm e}^{4 i \left (d x +c \right )}+25 b \,{\mathrm e}^{3 i \left (d x +c \right )}-1488 a \,{\mathrm e}^{2 i \left (d x +c \right )}-165 b \,{\mathrm e}^{i \left (d x +c \right )}-368 a \right )}{120 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{6}}+\frac {5 b \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{16 d}-\frac {5 b \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{16 d}\) \(199\)

[In]

int((a+b*sec(d*x+c))*tan(d*x+c)^6,x,method=_RETURNVERBOSE)

[Out]

1/d*(a*(1/5*tan(d*x+c)^5-1/3*tan(d*x+c)^3+tan(d*x+c)-d*x-c)+b*(1/6*sin(d*x+c)^7/cos(d*x+c)^6-1/24*sin(d*x+c)^7
/cos(d*x+c)^4+1/16*sin(d*x+c)^7/cos(d*x+c)^2+1/16*sin(d*x+c)^5+5/48*sin(d*x+c)^3+5/16*sin(d*x+c)-5/16*ln(sec(d
*x+c)+tan(d*x+c))))

Fricas [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 134, normalized size of antiderivative = 1.31 \[ \int (a+b \sec (c+d x)) \tan ^6(c+d x) \, dx=-\frac {480 \, a d x \cos \left (d x + c\right )^{6} + 75 \, b \cos \left (d x + c\right )^{6} \log \left (\sin \left (d x + c\right ) + 1\right ) - 75 \, b \cos \left (d x + c\right )^{6} \log \left (-\sin \left (d x + c\right ) + 1\right ) - 2 \, {\left (368 \, a \cos \left (d x + c\right )^{5} + 165 \, b \cos \left (d x + c\right )^{4} - 176 \, a \cos \left (d x + c\right )^{3} - 130 \, b \cos \left (d x + c\right )^{2} + 48 \, a \cos \left (d x + c\right ) + 40 \, b\right )} \sin \left (d x + c\right )}{480 \, d \cos \left (d x + c\right )^{6}} \]

[In]

integrate((a+b*sec(d*x+c))*tan(d*x+c)^6,x, algorithm="fricas")

[Out]

-1/480*(480*a*d*x*cos(d*x + c)^6 + 75*b*cos(d*x + c)^6*log(sin(d*x + c) + 1) - 75*b*cos(d*x + c)^6*log(-sin(d*
x + c) + 1) - 2*(368*a*cos(d*x + c)^5 + 165*b*cos(d*x + c)^4 - 176*a*cos(d*x + c)^3 - 130*b*cos(d*x + c)^2 + 4
8*a*cos(d*x + c) + 40*b)*sin(d*x + c))/(d*cos(d*x + c)^6)

Sympy [F]

\[ \int (a+b \sec (c+d x)) \tan ^6(c+d x) \, dx=\int \left (a + b \sec {\left (c + d x \right )}\right ) \tan ^{6}{\left (c + d x \right )}\, dx \]

[In]

integrate((a+b*sec(d*x+c))*tan(d*x+c)**6,x)

[Out]

Integral((a + b*sec(c + d*x))*tan(c + d*x)**6, x)

Maxima [A] (verification not implemented)

none

Time = 0.30 (sec) , antiderivative size = 134, normalized size of antiderivative = 1.31 \[ \int (a+b \sec (c+d x)) \tan ^6(c+d x) \, dx=\frac {32 \, {\left (3 \, \tan \left (d x + c\right )^{5} - 5 \, \tan \left (d x + c\right )^{3} - 15 \, d x - 15 \, c + 15 \, \tan \left (d x + c\right )\right )} a - 5 \, b {\left (\frac {2 \, {\left (33 \, \sin \left (d x + c\right )^{5} - 40 \, \sin \left (d x + c\right )^{3} + 15 \, \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{6} - 3 \, \sin \left (d x + c\right )^{4} + 3 \, \sin \left (d x + c\right )^{2} - 1} + 15 \, \log \left (\sin \left (d x + c\right ) + 1\right ) - 15 \, \log \left (\sin \left (d x + c\right ) - 1\right )\right )}}{480 \, d} \]

[In]

integrate((a+b*sec(d*x+c))*tan(d*x+c)^6,x, algorithm="maxima")

[Out]

1/480*(32*(3*tan(d*x + c)^5 - 5*tan(d*x + c)^3 - 15*d*x - 15*c + 15*tan(d*x + c))*a - 5*b*(2*(33*sin(d*x + c)^
5 - 40*sin(d*x + c)^3 + 15*sin(d*x + c))/(sin(d*x + c)^6 - 3*sin(d*x + c)^4 + 3*sin(d*x + c)^2 - 1) + 15*log(s
in(d*x + c) + 1) - 15*log(sin(d*x + c) - 1)))/d

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 228 vs. \(2 (94) = 188\).

Time = 2.13 (sec) , antiderivative size = 228, normalized size of antiderivative = 2.24 \[ \int (a+b \sec (c+d x)) \tan ^6(c+d x) \, dx=-\frac {240 \, {\left (d x + c\right )} a + 75 \, b \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 75 \, b \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) + \frac {2 \, {\left (240 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{11} - 75 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{11} - 1520 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} + 425 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} + 4128 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 990 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 4128 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 990 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 1520 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 425 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 240 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 75 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{6}}}{240 \, d} \]

[In]

integrate((a+b*sec(d*x+c))*tan(d*x+c)^6,x, algorithm="giac")

[Out]

-1/240*(240*(d*x + c)*a + 75*b*log(abs(tan(1/2*d*x + 1/2*c) + 1)) - 75*b*log(abs(tan(1/2*d*x + 1/2*c) - 1)) +
2*(240*a*tan(1/2*d*x + 1/2*c)^11 - 75*b*tan(1/2*d*x + 1/2*c)^11 - 1520*a*tan(1/2*d*x + 1/2*c)^9 + 425*b*tan(1/
2*d*x + 1/2*c)^9 + 4128*a*tan(1/2*d*x + 1/2*c)^7 - 990*b*tan(1/2*d*x + 1/2*c)^7 - 4128*a*tan(1/2*d*x + 1/2*c)^
5 - 990*b*tan(1/2*d*x + 1/2*c)^5 + 1520*a*tan(1/2*d*x + 1/2*c)^3 + 425*b*tan(1/2*d*x + 1/2*c)^3 - 240*a*tan(1/
2*d*x + 1/2*c) - 75*b*tan(1/2*d*x + 1/2*c))/(tan(1/2*d*x + 1/2*c)^2 - 1)^6)/d

Mupad [B] (verification not implemented)

Time = 15.02 (sec) , antiderivative size = 331, normalized size of antiderivative = 3.25 \[ \int (a+b \sec (c+d x)) \tan ^6(c+d x) \, dx=\frac {\left (\frac {5\,b}{8}-2\,a\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{11}+\left (\frac {38\,a}{3}-\frac {85\,b}{24}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9+\left (\frac {33\,b}{4}-\frac {172\,a}{5}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7+\left (\frac {172\,a}{5}+\frac {33\,b}{4}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+\left (-\frac {38\,a}{3}-\frac {85\,b}{24}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+\left (2\,a+\frac {5\,b}{8}\right )\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{12}-6\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}+15\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8-20\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+15\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-6\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}-\frac {5\,b\,\mathrm {atanh}\left (\frac {125\,b^3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{64\,\left (20\,a^2\,b+\frac {125\,b^3}{64}\right )}+\frac {20\,a^2\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{20\,a^2\,b+\frac {125\,b^3}{64}}\right )}{8\,d}-\frac {2\,a\,\mathrm {atan}\left (\frac {64\,a^3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{64\,a^3+\frac {25\,a\,b^2}{4}}+\frac {25\,a\,b^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{4\,\left (64\,a^3+\frac {25\,a\,b^2}{4}\right )}\right )}{d} \]

[In]

int(tan(c + d*x)^6*(a + b/cos(c + d*x)),x)

[Out]

(tan(c/2 + (d*x)/2)*(2*a + (5*b)/8) - tan(c/2 + (d*x)/2)^11*(2*a - (5*b)/8) - tan(c/2 + (d*x)/2)^3*((38*a)/3 +
 (85*b)/24) + tan(c/2 + (d*x)/2)^9*((38*a)/3 - (85*b)/24) + tan(c/2 + (d*x)/2)^5*((172*a)/5 + (33*b)/4) - tan(
c/2 + (d*x)/2)^7*((172*a)/5 - (33*b)/4))/(d*(15*tan(c/2 + (d*x)/2)^4 - 6*tan(c/2 + (d*x)/2)^2 - 20*tan(c/2 + (
d*x)/2)^6 + 15*tan(c/2 + (d*x)/2)^8 - 6*tan(c/2 + (d*x)/2)^10 + tan(c/2 + (d*x)/2)^12 + 1)) - (5*b*atanh((125*
b^3*tan(c/2 + (d*x)/2))/(64*(20*a^2*b + (125*b^3)/64)) + (20*a^2*b*tan(c/2 + (d*x)/2))/(20*a^2*b + (125*b^3)/6
4)))/(8*d) - (2*a*atan((64*a^3*tan(c/2 + (d*x)/2))/((25*a*b^2)/4 + 64*a^3) + (25*a*b^2*tan(c/2 + (d*x)/2))/(4*
((25*a*b^2)/4 + 64*a^3))))/d